import RandTool from "../../common/tool/RandTool";
import BodyFood from "../body/BodyFood";
import LocalCommon from "../config/LocalCommon";
import BarMap from "./BarMap";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LongBarMap extends BarMap {


    public createFood() {
        let foodPositonList = this.getFoodPositonXArray(this.FoodNumber);
        for (let j = 0; j < this.FoodNumber; j++) {
            let food = cc.instantiate(this.PrefabFood);
            let randTop = RandTool.RandIncludeAll(1, 2);
            food.position = cc.v3(foodPositonList[j] + LocalCommon.CubeWidth * 0.5, randTop * LocalCommon.CubeHeight * 0.5);
            let foodControl = food.getComponent(BodyFood);
            foodControl.init(this.mContextPool);
            this.node.addChild(food);
        }
    }

}
